Skip to content

[https://nvbugs/6484986][test] add UCX cancellation regression coverage#16688

Open
chienchunhung wants to merge 4 commits into
NVIDIA:mainfrom
chienchunhung:codex/nvbug-6484986-ucx-cancel
Open

[https://nvbugs/6484986][test] add UCX cancellation regression coverage#16688
chienchunhung wants to merge 4 commits into
NVIDIA:mainfrom
chienchunhung:codex/nvbug-6484986-ucx-cancel

Conversation

@chienchunhung

@chienchunhung chienchunhung commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a focused regression test for cancellation of a pending UCX recvConnect() during shutdown.
  • Bound the regression test with a 60-second CTest timeout so a recurrence is reported as a test timeout instead of hanging the executor test group.
  • Remove the two test waivers associated with NVBUG#6484986 and NVBUG#6488811.

Context

The production fix for the UCX shutdown deadlock is now present on main through PR #13055. Its recvConnect() implementation keeps the receive state alive through the UCXX callback, observes the existing transfer-termination flag, cancels the outstanding receive, and returns without waiting indefinitely for asynchronous cancellation completion.

After rebasing onto that implementation, this PR no longer replaces the production cancellation logic. It retains the regression coverage and waiver cleanup needed to verify the reported failures remain fixed.

Changes

  • Add UcxCommTest.recvConnectCancellation, which starts a pending receive, requests termination, and verifies that recvConnect() returns nullptr within five seconds.
  • Extend add_gtest() with an optional TIMEOUT property and set ucxCommTest to 60 seconds, ensuring a cancellation regression fails cleanly.
  • Remove the waiver for unittest/llmapi/test_llm_pytorch.py::test_llm_context_only_timed_out[None] (NVBUG#6484986).
  • Remove the waiver for unittest/llmapi/test_llm_pytorch.py::test_llm_context_only_timed_out_kv_cache_exhausted[None-UCX-100] (NVBUG#6488811).
  • Keep the separate [None-UCX-1000] waiver associated with NVBUG#6490004.

Verification

Current rebased head: 0fded855f on main commit 121cf56ae.

The two exact post-rebase per-test records in build 49822 report PASSED on A100X. They executed in the targeted stage rather than being skipped or waived, so the NVBUG#6484986 and NVBUG#6488811 waivers can remain removed.

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --stage-list "A100X-PyTorch-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60792 [ run ] triggered by Bot. Commit: a5b84de Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60792 [ run ] completed with state SUCCESS. Commit: a5b84de
/LLM/main/L0_MergeRequest_PR pipeline #49070 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --stage-list "A100X-PyTorch-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60833 [ run ] triggered by Bot. Commit: 5cba0c2 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #60833 [ run ] completed with state SUCCESS. Commit: 5cba0c2
/LLM/main/L0_MergeRequest_PR pipeline #49109 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@chienchunhung
chienchunhung force-pushed the codex/nvbug-6484986-ucx-cancel branch from 5cba0c2 to 2fd0b71 Compare July 22, 2026 16:21

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61024 [ run ] triggered by Bot. Commit: 2fd0b71 Link to invocation

@chienchunhung
chienchunhung requested a review from tburt-nv July 22, 2026 16:32
@chienchunhung
chienchunhung marked this pull request as ready for review July 22, 2026 16:32
@chienchunhung
chienchunhung requested review from a team as code owners July 22, 2026 16:32
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

recvConnect now cooperatively cancels pending UCX receives when termination is requested. Tests cover asynchronous cancellation, gtest discovery supports timeouts, and integration timeout waivers are updated.

Changes

UCX receive cancellation

Layer / File(s) Summary
Implement receive cancellation
cpp/tensorrt_llm/executor/cache_transmission/ucx_utils/ucxCacheCommunicator.cpp
recvConnect polls incomplete requests, checks termination, cancels requests, handles cancellation status, and returns nullptr.
Validate cancellation behavior
cpp/tests/unit_tests/executor/ucxCommTest.cpp, tests/integration/test_lists/waives.txt
Adds an asynchronous cancellation test and updates timeout-related integration waivers.
Configure test timeout
cpp/tests/CMakeLists.txt, cpp/tests/unit_tests/executor/CMakeLists.txt
Adds optional gtest timeout handling and assigns ucxCommTest a 60-second timeout.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant UcxCommTest
  participant UcxConnectionManager
  participant TransferContext
  participant UCXRequest

  UcxCommTest->>UcxConnectionManager: start recvConnect asynchronously
  UcxConnectionManager->>TransferContext: check termination flag
  UcxConnectionManager->>UCXRequest: poll pending receive
  UcxCommTest->>TransferContext: set termination flag
  UcxConnectionManager->>UCXRequest: cancel receive
  UCXRequest-->>UcxConnectionManager: return completion status
  UcxConnectionManager-->>UcxCommTest: return nullptr
Loading

Possibly related PRs

Suggested reviewers: tongyuantongyu, brnguyen2, fredricz-20070104, shixiaowei02, niukuo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: UCX cancellation regression coverage for recvConnect.
Description check ✅ Passed The description is mostly complete and includes summary, context, changes, and verification aligned with the template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
cpp/tests/unit_tests/executor/ucxCommTest.cpp (1)

101-107: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Apply the C++ const and brace-style rules.

Declare the unmodified connectionManager and error variables const, and put the lambda opening brace on its own line.

Proposed fix
-        auto connectionManager = makeOneUcxConnectionManager();
+        auto const connectionManager = makeOneUcxConnectionManager();
...
-            [&]() {
+            [&]()
+            {
...
-        std::string error = e.what();
+        std::string const error = e.what();

As per coding guidelines, “declare unmodified variables const” and “use Allman braces.”

Also applies to: 122-122

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tests/unit_tests/executor/ucxCommTest.cpp` around lines 101 - 107, Update
the test setup around makeOneUcxConnectionManager and the related error
declaration to mark unmodified variables const. Reformat the std::async lambda
associated with receiveFuture, and the additionally referenced lambda, so each
opening brace appears on its own line, following the project’s Allman brace
style.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/tests/unit_tests/executor/ucxCommTest.cpp`:
- Around line 120-129: Update the exception rethrow in the catch block to use a
bare throw statement instead of throwing the caught variable, preserving the
original exception type and diagnostics while leaving the UCX skip logic
unchanged.
- Around line 97-118: Update recvConnectCancellation to guard the asynchronous
recvConnect probe with an external per-test or process-level timeout, ensuring a
cancellation failure terminates or reports promptly without allowing the
std::async future destructor to block indefinitely after the timeout assertion.

---

Nitpick comments:
In `@cpp/tests/unit_tests/executor/ucxCommTest.cpp`:
- Around line 101-107: Update the test setup around makeOneUcxConnectionManager
and the related error declaration to mark unmodified variables const. Reformat
the std::async lambda associated with receiveFuture, and the additionally
referenced lambda, so each opening brace appears on its own line, following the
project’s Allman brace style.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 43d0fd11-d342-4cc5-a0f5-af0321ce757b

📥 Commits

Reviewing files that changed from the base of the PR and between 45d1c11 and 2fd0b71.

📒 Files selected for processing (3)
  • cpp/tensorrt_llm/executor/cache_transmission/ucx_utils/ucxCacheCommunicator.cpp
  • cpp/tests/unit_tests/executor/ucxCommTest.cpp
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

Comment thread cpp/tests/unit_tests/executor/ucxCommTest.cpp
Comment thread cpp/tests/unit_tests/executor/ucxCommTest.cpp
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61024 [ run ] completed with state FAILURE. Commit: 2fd0b71
/LLM/main/L0_MergeRequest_PR pipeline #49281 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung
chienchunhung force-pushed the codex/nvbug-6484986-ucx-cancel branch from 2fd0b71 to 87561d8 Compare July 22, 2026 19:14

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/tests/unit_tests/executor/ucxCommTest.cpp`:
- Line 101: Declare the unmodified local variables in the affected test cases as
const: change connectionManager in makeOneUcxConnectionManager usage to auto
const and declare error as std::string const. Apply this consistently at both
referenced locations without changing their behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bb26e44c-3d68-47ea-a52e-6b10818f2bac

📥 Commits

Reviewing files that changed from the base of the PR and between 2fd0b71 and 87561d8.

📒 Files selected for processing (3)
  • cpp/tensorrt_llm/executor/cache_transmission/ucx_utils/ucxCacheCommunicator.cpp
  • cpp/tests/unit_tests/executor/ucxCommTest.cpp
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/tensorrt_llm/executor/cache_transmission/ucx_utils/ucxCacheCommunicator.cpp

Comment thread cpp/tests/unit_tests/executor/ucxCommTest.cpp
Comment thread cpp/tests/unit_tests/executor/ucxCommTest.cpp
@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61204 [ run ] triggered by Bot. Commit: d628a68 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61169 [ run ] completed with state ABORTED. Commit: 1cddbfe

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61204 [ run ] completed with state FAILURE. Commit: d628a68
/LLM/main/L0_MergeRequest_PR pipeline #49448 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61315 [ run ] triggered by Bot. Commit: a039a8d Link to invocation

@chienchunhung
chienchunhung enabled auto-merge (squash) July 23, 2026 16:27
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61315 [ run ] completed with state FAILURE. Commit: a039a8d
/LLM/main/L0_MergeRequest_PR pipeline #49544 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61383 [ run ] triggered by Bot. Commit: a039a8d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61383 [ run ] completed with state FAILURE. Commit: a039a8d
/LLM/main/L0_MergeRequest_PR pipeline #49610 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@chienchunhung
chienchunhung force-pushed the codex/nvbug-6484986-ucx-cancel branch from a039a8d to ab8f928 Compare July 24, 2026 17:26
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
@chienchunhung
chienchunhung force-pushed the codex/nvbug-6484986-ucx-cancel branch from ab8f928 to 0fded85 Compare July 24, 2026 17:27
@chienchunhung chienchunhung changed the title [https://nvbugs/6484986][fix] cancel pending UCX receive [NVBUG 6484986][test] add UCX cancellation regression coverage Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --stage-list "A100X-PyTorch-1"

@chienchunhung chienchunhung changed the title [NVBUG 6484986][test] add UCX cancellation regression coverage [https://nvbugs/6484986][test] add UCX cancellation regression coverage Jul 24, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61615 [ run ] triggered by Bot. Commit: 0fded85 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61615 [ run ] completed with state SUCCESS. Commit: 0fded85
/LLM/main/L0_MergeRequest_PR pipeline #49822 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61640 [ run ] triggered by Bot. Commit: 0fded85 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61640 [ run ] completed with state FAILURE. Commit: 0fded85
/LLM/main/L0_MergeRequest_PR pipeline #49847 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61665 [ run ] triggered by Bot. Commit: 0fded85 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61665 [ run ] completed with state FAILURE. Commit: 0fded85
/LLM/main/L0_MergeRequest_PR pipeline #49871 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants